package com.xingongchang.baolebei.protocol;

import org.json.JSONException;
import org.json.JSONObject;

import com.external.activeandroid.Model;
import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;
import com.insthub.BeeFramework.view.SlideView;

@Table(name = "LETTER_DETAIL")
public class LETTER_DETAIL extends Model {

	public SlideView slideView;

	@Column(name = "letterid")
	public int letterid;

	@Column(name = "creaton")
	public String creaton;

	@Column(name = "friendPhoto")
	public String friendPhoto;

	@Column(name = "sendPhoto")
	public String sendPhoto;
	
	@Column(name = "content")
	public String content;

	@Column(name = "is_send")
	public int is_send;

	public static LETTER_DETAIL fromJson(JSONObject jsonObject)
			throws JSONException {
		if (null == jsonObject) {
			return null;
		}
		LETTER_DETAIL localItem = new LETTER_DETAIL();

		localItem.content = jsonObject.optString("content");
		localItem.is_send = jsonObject.optInt("is_send");
		localItem.creaton = jsonObject.optString("creaton");
		localItem.friendPhoto = jsonObject.optString("friendPhoto");
		localItem.sendPhoto = jsonObject.optString("sendPhoto");
		localItem.letterid = jsonObject.optInt("id");

		return localItem;
	}

}